package cn.wolfcode.filter;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Description: 根据信息SQL92过滤
 * @Author: 伍家钰
 * @Date: 2020/9/4 13:37
 * @Version: 1.0
 */
@Component
@RocketMQMessageListener(
        topic = "02-sql-Filter",
        consumerGroup = "sal-Filter-group",
        // 根据元素标签过滤
        /*selectorType = SelectorType.TAG,
        selectorExpression = "tagA||tagZ"*/
        selectorType = SelectorType.SQL92,
        selectorExpression = "age > 19"
)
public class Sql92FilterConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        System.out.println("发送的消息:" + s);
    }
}
